import time

import requests
'''
1. 5sing歌曲列表寻找不到
'''
expando = "jQuery17079426496683222743"
cf = int(time.time()*1000) + 1
#1650716304184
# 转换为其他日期格式,如:"%Y-%m-%d %H:%M:%S"
now = 1650717701.748
timeArray = time.localtime(now)
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
print(otherStyleTime)
jsonpCallback = expando + "_" + str(cf)
print(jsonpCallback)
#jQuery1705949976364799423_1650716272425
#jQuery1703591443994345114_1650716439995
#jQuery170517052486007535 _1650716463899

heards = {
    "Accept": "*/*,",
    "Accept-Encoding": "gzip, deflate",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Cookie": "UM_distinctid=1804c7674b412e0-0d8bdd903482bb-6b3e555b-e1000-1804c7674b5107a; kg_mid=9ff369d94ad40ef0bbe7aaaa8777f71a; kg_dfid=2C7tuH3Qkqdm4XCOBD4ZpKuo; wsp_volume=0.8; 5sing_auth=web_38ca1bb99942aacd5ad44b8c6af549d8; 5SING_TAG_20220421=GF_ST-12.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7C_ST-12.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CHY_ST-13.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CLS_ST-1.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0; 5SING_TAG_20220422=LX_ST-3.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CHY_ST-6.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CGF_ST-3.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7C_ST-3.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CDM_ST-1.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CQT_ST-1.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0; kg_dfid_collect=d41d8cd98f00b204e9800998ecf8427e; 5SING_TAG_20220423=GF_ST-2.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7C_ST-2.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0%7CHY_ST-2.STW-0.SC-0.PL-0.FX-0.ZF-0.ZC-0.XZ-0.DZ-0; kg_mid_temp=9ff369d94ad40ef0bbe7aaaa8777f71a; cct=bc6e7f38"
    ,"Host": "service.5sing.kugou.com",
    "Pragma": "no-cache",
    "Referer": "http://5sing.kugou.com/",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
data = {
    "jsoncallback": "jQuery1703591443994345114_1650716439995",
    "songid": "4292404",
    "songtype": "yc",
    "from": "web",
    "version": "6.6.72",
    "_": "1650716440281",
}
# 1650716439995
# 1650716440281
data["jsoncallback"] = jsonpCallback
data["_"] = str(cf + 10680)
# url = "http://service.5sing.kugou.com/song/getsongurl?jsoncallback=jQuery1709365554031136369_1650718346820&songid=4292404&songtype=yc&from=web&version=6.6.72&_=1650718347049"
url = "http://service.5sing.kugou.com/song/getsongurl?jsoncallback={0}&songid=4292404&songtype=yc&from=web&version=6.6.72&_={1}".format(jsonpCallback, cf)
resp = requests.get(url)
# url = "http://service.5sing.kugou.com/song/getsongurl"
# resp = requests.get(url=url, headers=heards, data=data)
print(resp.text)
'''
jsoncallback:   jQuery1707942649668822788_1650717104075
                jQuery1707942649668822788_1650717392643
songid: 4292404
songtype: yc
from: web
version: 6.6.72
_: 1650717104160
'''

# homePage.search = globals.urlPrefix.sou + "home/json";

# globals.urlPrefix.sou = "http://search.5sing.kugou.com/"
'''
"[{"createTime":"2009-06-07 16:14:00","originSinger":"","songName":"<em class=\"keyword\">\u67f3<\/em>","status":1,"songSize":0,"style":"RAP\/\u8bf4\u5531","downloadCnt":200,"playCnt":4051,"singer":"MOE\u6b23\u6b23\uff08\u5218\u73a5\uff09","postProduction":"MOE\u6b23\u6b23\uff08\u5218\u73a5\uff09","popularityCnt":233617,"songWriter":"MOE\u6b23\u6b23\uff08\u5218\u73a5\uff09","collectCnt":16,"composer":"MOE\u6b23\u6b23\uff08\u5218\u73a5\uff09","songId":239835,"ext":"mp3","optComposer":"\u65b0\u89c6\u542c-\u5c0f\u94c1\u5320","nickName":"\u6a02\u65c5\u6d77\u6b23","singerId":1169225,"type":1,"typeName":"\u539f\u521b","songurl":"http:\/\/5sing.kugou.com\/yc\/239835.html","downloadurl":"http:\/\/5sing.kugou.com\/yc\/down\/239835","typeEname":"yc"},{"createTime":"2010-04-13 22:43:00","originSinger":"","songName":"<em class=\"keyword\">\u67f3<\/em>","status":1,"songSize":0,"style":"","downloadCnt":14,"playCnt":2193,"singer":"\u65b0\u89c6\u542c-\u6b23\u6b23","postProduction":"\u65b0\u89c6\u542c-\u6b23\u6b23","popularityCnt":95038,"songWriter":"\u65b0\u89c6\u542c-\u6b23\u6b23","collectCnt":15,"composer":"\u65b0\u89c6\u542c-\u6b23\u6b23","songId":403716,"ext":"mp3","optComposer":"\u65b0\u89c6\u542c-\u5c0f\u94c1\u5320","nickName":"\u6653\u5b87","singerId":3150681,"type":1,"typeName":"\u539f\u521b","songurl":"http:\/\/5sing.kugou.com\/yc\/403716.html","downloadurl":"http:\/\/5sing.kugou.com\/yc\/down\/403716","typeEname":"yc"},{"createTime":"2013-01-14 13:06:00","originSinger":"\u897f\u53f6\u5b50","songName":"\u65e0\u6daf","status":1,"collectCnt":2,"style":"\u53e4\u98ce","downloadCnt":9,"playCnt":1746,"singer":"\u5c0f<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":67679,"songWriter":"","composer":"","songId":8463953,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/8463953.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/8463953","typeEname":"fc"},{"createTime":"2012-03-26 19:34:00","originSinger":"\u4f9d\u7a46\u708e&\u731b\u5e72\u9009\u624b","songName":"\u620f\u8bed\u82b1","status":1,"collectCnt":2,"style":"\u53e4\u5178","downloadCnt":15,"playCnt":672,"singer":"<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":43681,"songWriter":"","composer":"","songId":5736792,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/5736792.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/5736792","typeEname":"fc"},{"createTime":"2012-05-26 19:14:00","originSinger":"\u521d\u97f3\u672a\u6765","songName":"\u5b5f\u6625","status":1,"collectCnt":0,"style":"","downloadCnt":8,"playCnt":327,"singer":"<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":22234,"songWriter":"","composer":"","songId":6280248,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/6280248.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/6280248","typeEname":"fc"},{"createTime":"2011-06-08 02:17:00","originSinger":"","songName":"<em class=\"keyword\">\u67f3<\/em>","status":1,"songSize":10351909,"style":"\u7eaf\u97f3\u4e50","downloadCnt":12,"playCnt":417,"singer":"\u65e0","postProduction":"\u65e0","popularityCnt":19542,"songWriter":"\u674e\u5efa\u8f89","collectCnt":0,"composer":"\u4e8c\u53f8","songId":725031,"ext":"mp3","optComposer":"\u4e8c\u53f8","nickName":"\u4e8c\u53f8","singerId":10261288,"type":1,"typeName":"\u539f\u521b","songurl":"http:\/\/5sing.kugou.com\/yc\/725031.html","downloadurl":"http:\/\/5sing.kugou.com\/yc\/down\/725031","typeEname":"yc"},{"createTime":"2013-08-22 23:47:00","originSinger":"\u6d1b\u5929\u4f9d","songName":"\u60dc\u6625\u53bb","status":1,"collectCnt":0,"style":"\u53e4\u98ce|","downloadCnt":5,"playCnt":309,"singer":"\u5c0f<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":16812,"songWriter":"","composer":"","songId":10598646,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/10598646.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/10598646","typeEname":"fc"},{"createTime":"2013-05-07 20:07:00","originSinger":"EGOIST","songName":"\u30a8\u30a6\u30c6\u30eb\u30da","status":1,"collectCnt":1,"style":"\u6d41\u884c","downloadCnt":2,"playCnt":282,"singer":"\u5c0f<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":13503,"songWriter":"","composer":"","songId":9526668,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/9526668.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/9526668","typeEname":"fc"},{"createTime":"2012-02-03 22:47:00","originSinger":"\u5218\u8bd7\u8bd7","songName":"\u7b49\u4f60\u7684\u5b63\u8282","status":1,"collectCnt":0,"style":"NULL","downloadCnt":1,"playCnt":168,"singer":"\u00b7\u3013<em class=\"keyword\">\u67f3<\/em>\u3013\u00b7","postProduction":"","popularityCnt":13033,"songWriter":"","composer":"","songId":5304903,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u00b7\u3013\u67f3\u3013\u00b7","singerId":16000611,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/5304903.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/5304903","typeEname":"fc"},{"createTime":"2013-07-20 23:25:00","originSinger":"\u65e0","songName":"[\u5eff\u56db\u756a\u82b1\u4fe1\u98ce][\u68e3\u68e0]\u9022\u68a6","status":1,"collectCnt":2,"style":"\u53e4\u98ce","downloadCnt":2,"playCnt":237,"singer":"\u5c0f<em class=\"keyword\">\u67f3<\/em>","postProduction":"","popularityCnt":12507,"songWriter":"","composer":"","songId":10242249,"optComposer":"","ext":"mp3","songSize":0,"nickName":"\u3010\u67f3\u3011","singerId":9135811,"type":2,"typeName":"\u7ffb\u5531","songurl":"http:\/\/5sing.kugou.com\/fc\/10242249.html","downloadurl":"http:\/\/5sing.kugou.com\/fc\/down\/10242249","typeEname":"fc"}]"
'''